<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>团队成员页面</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${re.contextPath}/plugin/layui/css/layui.css" media="all"/>
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body style="background-color: #fff">
<div class="layui-container" style="padding-top:20px">
    <div class="layui-row">
        <strong><h2 id="projectName"></h2></strong>
    </div>
    <div class="layui-row">
        <table id="memberTable"></table>
    </div>
</div>

<script type="text/javascript" src="${re.contextPath}/plugin/layui/layui.all.js"></script>
<!--JQ-->
<script type="text/javascript" charset="utf-8" src="${re.contextPath}/plugin/common/js/jquery-1.8.3.min.js"></script>
<script type="text/html" id="index">
    {{d.LAY_INDEX}}
</script>
<script>
    var table;
    layui.use('table', function () {
        table = layui.table;
        var tableType = localStorage.getItem("form-smart-table-type");
        if(tableType && tableType == 'lunwenCountDetail'){
            var searchJsonData = localStorage.getItem("lunwenSearchJsonData");
            var searchObj = {};
            if(searchJsonData){
                searchObj = JSON.parse(searchJsonData);
            }
            tableIns = table.render({
                id: 'memberTable',
                elem: '#memberTable',
                height: "full",
                page: true,
                url: '/search/decision/form/statistics/detail/110005?index=0',
                where: searchObj,
                cols: [[
                    {field:'index',title: '序号', width: '20%', templet: function (res) {
                            return res.LAY_INDEX;
                        }
                    },
                    {field: 'author', title: '姓名', width: '20%'},
                    {field: 'name', title: '论文名称', width: '60%'}
                ]],
                done: function (res, currentCount) {
                    localStorage.removeItem('form-smart-table-type');
                }
            });
        }else if(tableType && tableType == 'colsAndDatas'){
            var cols = JSON.parse(localStorage.getItem("colsAndDatas-cols"));
            var tableData = JSON.parse(localStorage.getItem("colsAndDatas-datas"));
            tableIns = table.render({
                id: 'memberTable',
                elem: '#memberTable',
                height: "full",
                page: true,
                data: tableData,
                cols: cols,
                done: function (res, currentCount) {
                    localStorage.removeItem('form-smart-table-type');
                }
            });
        }else{
            //方法级渲染
            var membersStr = localStorage.getItem("form-project-members");
            var members = JSON.parse(membersStr);
            var fieldName = localStorage.getItem("form-project-field-name");
            tableIns = table.render({
                id: 'memberTable',
                elem: '#memberTable',
                height: "full",
                page: true,
                data: members,
                cols: [[
                    {field:'index',title: '序号', width: '20%'},
                    {field: 'name', title: fieldName, width: '80%'}
                ]],
                done: function (res, currentCount) {

                }
            });
        }
    });

    $(function(){
        var projectName = localStorage.getItem("form-project-name");
        if(projectName){
            $('#projectName').html(projectName);
        }
    })

</script>
</body>
</html>